package com.lsh.dao;

import com.lsh.entity.QueryPageBean;
import com.lsh.pojo.CheckGroup;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;
import org.springframework.stereotype.Service;

import java.util.List;

public interface CheckGroupDao {
    void add(CheckGroup checkGroup);
    List<CheckGroup> findPage(QueryPageBean queryPageBean);
    @Select("select * from t_checkgroup where id = #{id}")
    CheckGroup findById(Integer id);
    @Update("update t_checkgroup set code=#{code},name=#{name},helpCode=#{helpCode}," +
            "sex=#{sex},remark=#{remark},attention=#{attention} where id=#{id}")
    void update(CheckGroup checkGroup);
    @Select("select count(0) from t_setmeal_checkgroup where checkgroup_id = #{id}")
    int findSetmealCountByCheckGroupId(Integer id);
    @Delete("delete from t_checkgroup where id = #{id}")
    void delete(Integer id);
    @Select("select * from t_checkgroup")
    List<CheckGroup> findAll();
}
